home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_10
/
9n10118b
< prev
next >
Wrap
Text File
|
1991-08-14
|
667b
|
38 lines
/* Recursively call main() : VAX-C v3.1 */
#include <stdio.h>
main( argc, argv )
int argc;
char **argv;
{
char *new_argv[] = {NULL, "1", "2", "3", NULL};
int i;
static int level = 0;
void (*pf) (int, char *);
/* Test level of recursion */
if (level < 2 )
{
printf( "\nLevel = %ld\n", level );
level++;
}
else
exit ();
/* Print arguments */
i = 0;
while ( argv[i] )
{
printf( "argv[%ld] -> %s\n", i, argv[i] );
i++;
}
/* Recursively call main () */
new_argv[0] = argv[0];
pf = main;è (*pf) ( 3, new_argv );
}